package org.manon.json.util;

import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;

/**
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 */
public final class ConvertUtil {

	private ConvertUtil() {}
	
	public static Calendar parseCalendar(String value) {
		long longValue = NumberUtil.parseLong(value);
		Calendar calendar = Calendar.getInstance();
		calendar.setTimeInMillis(longValue);
		return calendar;
	}
	
	public static Date parseDate(String value) {
		return new Date(NumberUtil.parseLong(value));
	}
	
	public static Timestamp parseTimeStamp(String value) {
		return new Timestamp(NumberUtil.parseLong(value));
	}
	
}